10db3b5ce912ad4bda2662764dde584d179e8e83,rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfoComparator.java,OperationResourceInfoComparator,compare,#OperationResourceInfo#OperationResourceInfo#,65
Before Change
e2.getURITemplate());
if (result == 0 && (e1.getHttpMethod() != null && e2.getHttpMethod() == null
|| e1.getHttpMethod() == null && e2.getHttpMethod() != null)) {
// resource method takes precedence over a subresource locator
return e1.getHttpMethod() != null ? -1 : 1;
}
After Change
}
}
String e1HttpMethod = e1.getHttpMethod();
String e2HttpMethod = e2.getHttpMethod();
int result = 0;
if (!getMethod && HttpMethod.HEAD.equals(httpMethod)) {
result = compareWithHead(e1HttpMethod, e2HttpMethod);
if (result != 0) {
return result;
}
}
result = URITemplate.compareTemplates(
e1.getURITemplate(),
e2.getURITemplate());
if (result == 0 && (e1HttpMethod != null && e2HttpMethod == null
|| e1HttpMethod == null && e2HttpMethod != null)) {
// resource method takes precedence over a subresource locator
return e1.getHttpMethod() != null ? -1 : 1;
}
if (result == 0 && !getMethod) {
result = JAXRSUtils.compareSortedConsumesMediaTypes(
e1.getConsumeTypes(),
e2.getConsumeTypes(),
contentType);
}
if (result == 0) {
//use the media type of output data as the secondary key.
result = JAXRSUtils.compareSortedAcceptMediaTypes(e1.getProduceTypes(),
e2.getProduceTypes(),
acceptTypes);
}
if (result == 0 && e1HttpMethod != null && e2HttpMethod != null) {
boolean e1IsDefault = DefaultMethod.class.getSimpleName().equals(e1HttpMethod);
boolean e2IsDefault = DefaultMethod.class.getSimpleName().equals(e2HttpMethod);
if (e1IsDefault && !e2IsDefault) {
result = 1;
} else if (!e1IsDefault && e2IsDefault) {